package dfbz.demo04;

public class son extends parsent {
    String name="小金";
    public son(String name){
        super(name);
    }
    @Override
    public void method(){
        System.out.println("我是子类的方法");
    }
    public String getStr(){//子类的返回值的类型必须小于父类的返回类型
        return "aa";
    }
    public void eat(){  //子类的权限修饰符必须大于或者等于父类的权限修饰符
        System.out.println("今晚吃不吃饭");
    }
}
